package cl.tinet.finalexam.model;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="salas")
public class ClassroomModel implements Serializable{

    /**
     * TODO doc information expected for serialVersionUID attribute.
     */
    private static final long serialVersionUID = 1L;

    @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy="classroomEntity")
    private Collection<ReserveModel> reservesCollections;
    /**
     * Link room code from BD.
     */
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)   
    @Column(name = "salaID")
    private int roomCode;

    /**
     * Link address from BD.
     */
    @Column(name = "ubicacion")
    private String address;

    /**
     * Link room name from BD.
     */
    @Column(name = "nombreSala")
    private String roomName;

    /**
     * Link proyector from BD.
     */
    @Column(name = "proyector")
    private boolean hasProyector;

    /**
     * Link user tv from BD.
     */
    @Column(name = "televisor")
    private boolean hasTv;
    
    /**
     * Link user capacity from BD.
     */
    @Column(name = "capacidad")
    private int capacity;
    
    public ClassroomModel(){
        
    }

    /**
     * TODO doc information expected for ClassroomModel constructor.
     *
     * @param roomCode
     * @param address
     * @param roomName
     * @param hasProyector
     * @param hasTv
     * @param capacity
     */
    public ClassroomModel(int roomCode, String address, String roomName,
            boolean hasProyector, boolean hasTv, int capacity) {
        super();
        this.roomCode = roomCode;
        this.address = address;
        this.roomName = roomName;
        this.hasProyector = hasProyector;
        this.hasTv = hasTv;
        this.capacity = capacity;
    }

    /**
     * Allows to get the roomCode attribute value.
     * @return the roomCode value.
     */
    public int getRoomCode() {
        return roomCode;
    }

    /**
     * Allows to set the roomCode attribute value.
     *
     * @param roomCode new value for roomCode attribute.
     */
    public void setRoomCode(int roomCode) {
        this.roomCode = roomCode;
    }

    /**
     * Allows to get the address attribute value.
     * @return the address value.
     */
    public String getAddress() {
        return address;
    }

    /**
     * Allows to set the address attribute value.
     *
     * @param address new value for address attribute.
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * Allows to get the roomName attribute value.
     * @return the roomName value.
     */
    public String getRoomName() {
        return roomName;
    }

    /**
     * Allows to set the roomName attribute value.
     *
     * @param roomName new value for roomName attribute.
     */
    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    /**
     * Allows to get the hasProyector attribute value.
     * @return the hasProyector value.
     */
    public boolean isHasProyector() {
        return hasProyector;
    }

    /**
     * Allows to set the hasProyector attribute value.
     *
     * @param hasProyector new value for hasProyector attribute.
     */
    public void setHasProyector(boolean hasProyector) {
        this.hasProyector = hasProyector;
    }

    /**
     * Allows to get the hasTv attribute value.
     * @return the hasTv value.
     */
    public boolean isHasTv() {
        return hasTv;
    }

    /**
     * Allows to set the hasTv attribute value.
     *
     * @param hasTv new value for hasTv attribute.
     */
    public void setHasTv(boolean hasTv) {
        this.hasTv = hasTv;
    }

    /**
     * Allows to get the capacity attribute value.
     * @return the capacity value.
     */
    public int isCapacity() {
        return capacity;
    }

    /**
     * Allows to set the capacity attribute value.
     *
     * @param capacity new value for capacity attribute.
     */
    public void setCapacity(int capacity) {
        this.capacity = capacity;
    }

    /**
     * Allows to get the reservesCollections attribute value.
     * @return the reservesCollections value.
     */
    public Collection<ReserveModel> getReservesCollections() {
        return reservesCollections;
    }

    /**
     * Allows to set the reservesCollections attribute value.
     *
     * @param reservesCollections new value for reservesCollections attribute.
     */
    public void setReservesCollections(Collection<ReserveModel> reservesCollections) {
        this.reservesCollections = reservesCollections;
    }

    /**
     * Allows to get the capacity attribute value.
     * @return the capacity value.
     */
    public int getCapacity() {
        return capacity;
    }
    
    
    
    
}
